﻿<%@ Control Language="C#" %>
<%@ Register Assembly="Antu.WebControls" Namespace="Antu.WebControls" TagPrefix="CBW" %>
<asp:PlaceHolder ID="showshouliHolder" runat="server">

    <script type="text/javascript">
        function GetDropDownListText(ctrl) {
            var strReturn;
            for (i = 0; i < ctrl.options.length; i++) {
                if (ctrl.options[i].selected) {
                    strReturn = ctrl.options[i].text;
                    break;
                }
            }
            return strReturn;
        }
        function select_project() {
            var selectobj = document.getElementById('<%=flowdownlist.ClientID %>');
            var selectid = GetDropDownListText(selectobj);
            if (selectid == "房屋征收补偿决定") {
                var url = '../ZJManage/ZS_SelectPeople.aspx?rd=' + Math.random();
                var feature = "dialogWidth:" + 1000 + "px;dialogHeight:" + 650 + "px;scroll:yes;status:no;help:no;center:1";
                var project_info = window.showModalDialog(url, '', feature);
                if (project_info != undefined && project_info.length > 1) {
                    document.getElementById('<%=taskid.ClientID %>').value = project_info[0];
                    document.getElementById('<%=taskname.ClientID %>').value = project_info[1];
                }

            } else {
                var url = '../ZJManage/ZS_SelectProject.aspx?TYPE=' + escape(selectid) + "&rd=" + Math.random();
                var feature = "dialogWidth:" + 1000 + "px;dialogHeight:" + 650 + "px;scroll:yes;status:no;help:no;center:1";
                var project_info = window.showModalDialog(url, '', feature);
                if (project_info != undefined && project_info.length > 1) {
                    document.getElementById('<%=taskid.ClientID %>').value = project_info[0];
                    document.getElementById('<%=taskname.ClientID %>').value = project_info[2];
                }
            }
        }
        function select_project1() {
            var selectobj = document.getElementById('<%=flowdownlist.ClientID %>');
            var selectid = GetDropDownListText(selectobj);
            if (selectid == "房屋征收补偿决定") {
                var url = '../ZJManage/ZS_SelectPeople1.aspx?rd=' + Math.random();
                var feature = "dialogWidth:" + 1000 + "px;dialogHeight:" + 650 + "px;scroll:yes;status:no;help:no;center:1";
                var project_info = window.showModalDialog(url, '', feature);
                if (project_info != undefined && project_info.length > 1) {
                    document.getElementById('<%=taskid.ClientID %>').value = project_info[0];
                    document.getElementById('<%=taskname.ClientID %>').value = project_info[1];
                }

            } else {
                var url = '../ZJManage/ZS_SelectProject1.aspx?TYPE=' + escape(selectid) + "&rd=" + Math.random();
                var feature = "dialogWidth:" + 1000 + "px;dialogHeight:" + 650 + "px;scroll:yes;status:no;help:no;center:1";
                var project_info = window.showModalDialog(url, '', feature);
                if (project_info != undefined && project_info.length > 1) {
                    document.getElementById('<%=taskid.ClientID %>').value = project_info[0];
                    document.getElementById('<%=taskname.ClientID %>').value = project_info[2];
                }
            }
        }
        function ckownerid() {
            var tt = document.getElementById('<%=taskname.ClientID %>');
            if (tt != null && tt != '') {
                if (tt.value != null && tt.value != '') { return true; } else { alert('未选择数据，请点击数据导入按钮选择数据'); return false; }
            } else { return false; }
        }
        function aa() {
            var selectobj = document.getElementById('<%=flowdownlist.ClientID %>');
            var selectid = GetDropDownListText(selectobj);
            var toobj = document.getElementById('span1');
            if (selectid == "房屋征收补偿决定") {
                toobj.innerHTML = "被征收人（或实施单位）";
            } else {
                toobj.innerHTML = "申请单位(或受理名称)";
            }
        }
        window.onload = function aa() {
            var selectobj = document.getElementById('<%=flowdownlist.ClientID %>');
            var selectid = GetDropDownListText(selectobj);
            var toobj = document.getElementById('span1');
            if (selectid == "房屋征收补偿决定") {
                toobj.innerHTML = "被征收人（或实施单位）";
            } else {
                toobj.innerHTML = "申请单位(或受理名称)";
            }
        };
    </script>

    <table class="gridtable">
        <tr>
            <th colspan="2">
                案件受理
            </th>
        </tr>
        <tr>
            <td style="width: 40%; text-align: right">
                案件类型：
            </td>
            <td style="text-align: left">
                <asp:DropDownList ID="flowdownlist" runat="server" onchange="aa()">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td style="text-align: right">
                <span id="span1">
                    <asp:Label ID="Label1" runat="server" Text="申请单位(或受理名称)"></asp:Label></span>：
            </td>
            <td style="text-align: left">
                <asp:TextBox ID="taskname" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input id="Button2" type="button" value="案件补录" onclick="select_project1()" />
                <input id="Button1" type="button" value="数据导入" onclick="select_project()" />
                <asp:Button ID="acceptbtn" runat="server" Text="案件受理" OnClientClick="return ckownerid();" />
            </td>
        </tr>
    </table>
    <div style="display: none1;">
        <asp:TextBox ID="taskid" runat="server"></asp:TextBox>
    </div>
</asp:PlaceHolder>
<asp:PlaceHolder ID="wuquanHolder" runat="server" Visible="false">
    <table class="gridtable">
        <tr>
            <th>
                你无权受理流程！
            </th>
        </tr>
    </table>
</asp:PlaceHolder>
